package com.zkingsoft.actions.admin;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zkingsoft.actions.common.BaseController;
import com.zkingsoft.constance.Dictionary;
import com.zkingsoft.plugin.util.ImageUtil;
import com.zkingsoft.pojo.AjaxResult;

/**
 * base64Image解码
 */
@Controller
@RequestMapping(value = "admin/base64Image")
public class Base64ToImageContorller extends BaseController {

	
	/**
	 * 图片上传解码
	 */
	@RequestMapping(value = "/imgSrc")
	public @ResponseBody AjaxResult showForm(String imgSrc) {
		String url=ImageUtil.base64Tomage(imgSrc, Dictionary.SAVE_PATH);
		url=url.replace(Dictionary.SAVE_PATH,Dictionary.SAVE_URL);
		AjaxResult result=new AjaxResult(AjaxResult.STATUS_OK, null, url);
		return result;
	}
}